var SolarTerms = angular.module("SolarTerms", ['ui.router', 'ngAnimate']);
SolarTerms.run(function ($state, $timeout, $rootScope) {

    if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
        $rootScope.mobileApp = true;
    } else {

    }

});
SolarTerms.config(function ($stateProvider, $urlRouterProvider) {
    $urlRouterProvider.otherwise('/index/home');
    $stateProvider
        .state('index', {
            url: '/index',
            views: {
                '': {
                    templateUrl: 'module/indexRouter.html',
                    controller: 'mainCtrl'
                },
                'header@index': {
                    templateUrl: 'module/header.html'
                },
                'slidebox@index': {
                    templateUrl: 'module/slidebox.html',
                    controller:'slideCtrl'
                },
                'copyright@index': {
                    templateUrl: 'module/copyright.html'
                },
            }
        })//主页
        .state('index.home', {
            url: '/home',
            views: {
                '': {
                    templateUrl: 'module/home.html',
                    controller: 'homeCtrl'
                }
            }
        })
        .state('index.search', {
            url: '/search/:view',
            params:{
                waybill:''
            },
            views: {
                '': {
                    templateUrl: 'module/search.html',
                    controller: 'searchCtrl'
                },
                'Waybill@index.search': {
                    templateUrl: 'module/Waybill.html',
                    controller: 'WaybillCtrl'
                }
            }
        })
        .state('index.newsList',{
            url:'/newList',
            views:{
                '':{
                    templateUrl:'module/newsList.html',
                    controller:'newsListCtrl'
                }
            }
        })
        .state('index.newsInfo',{
            url:'/newsInfo/:id',
            views:{
                '':{
                    templateUrl:'module/newsInfo.html',
                    controller:'newsInfoCtrl'
                }
            }
        })
        .state('index.aboutUs',{
            url:'/aboutUs',
            views:{
                "":{
                    templateUrl:"module/aboutUs.html",
                    controller:'aboutUsCtrl'
                }
            }
        })
        .state('index.partners',{
            url:'/partners',
            views:{
                "":{
                    templateUrl:"module/partners.html",
                    controller:'partnersCtrl'
                }
            }
        })
});